<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCategoriesTable extends Migration
{
    public function up()
    {
        Schema::create('categories', function (Blueprint $table) {
	        $table->id();
	        $table->unsignedBigInteger('parent_id')->default(0)->index();
	        $table->unsignedBigInteger('transfer_id')->default(0)->index();
	        $table->string('name')->nullable();
	        $table->string('name_mini')->nullable()->comment('abbreviation');
	        $table->string('image')->nullable()->comment('category image');
	        $table->boolean('is_show')->default(true);
	        $table->unsignedBigInteger('order')->default(1);
	        $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('categories');
    }
}
